<?php
namespace app\admin\model\system;
use app\admin\model\user\User;
use app\common\traits\ModelCurd;
use think\Model;
class Notice extends Model
{
    use ModelCurd;
    protected $autoWriteTimestamp = true;
    protected $table = 'cp_notice_post';
    protected $json = ['more'];
    protected $type = [
        'published_time'  =>  'timestamp',
    ];
    public function user()
    {
        return $this->belongsTo(User::class,"user_id");
    }
    public function getMoreAttr($value,$data)
    {
        if($value){
            return json_decode( json_encode( $value),true);
        }
    }
}